package model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;

import enums.Privilege;

@Entity
@Table(name = "User")
public class User {
	

	@Enumerated
	private static final Privilege PRIVILEGE = Privilege.USER;

	
	private String userName;
	private String password;
	private String name;
	private String lastName;
	private String email;
	private byte[] photo;

	@Id
	@Column(name ="User_Name", nullable=false, length=20, unique=true)
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	@Column(name ="Password", nullable=false, length=10)
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	@Column(name = "Name", nullable=false)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name = "Last_Name", nullable=false)
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	
	@Column(name = "Email", nullable=false)
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
	@Lob
	@Column(name= "USER_IMAGE")
	public byte[] getPhoto() {
		return photo;
	}

	public void setPhoto(byte[] photo) {
		this.photo = photo;
	}
	
	@Enumerated
	public static Privilege getPRIVILEGE() {
		return PRIVILEGE;
	}
	


	

	
	
	
}

